home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / DevGear / Source / Includes / DGDebugging.h next >
Encoding:
C/C++ Source or Header  |  2000-06-24  |  1.1 KB  |  58 lines

  1. /*    =============
  2.  *    DGDebugging.h
  3.  *    =============
  4.  */
  5.  
  6. #ifndef DGDEBUGGING_H
  7. #define DGDEBUGGING_H
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13.  
  14. #ifdef _NO_DEBUGGING_AT_ALL_NOT_EVEN_A_LITTLE_BIT
  15.  
  16. #undef _USE_MWERKS_DEBUGGING
  17. #define DebugBeep()
  18. #define SignalPStr_(pstr)
  19.  
  20. #else /* _NO_DEBUGGING_AT_ALL_NOT_EVEN_A_LITTLE_BIT */
  21.  
  22. void DebugBeep(void);
  23.  
  24. #define SignalPStr_(pstr)  do {DebugBeep();} while (0)
  25.  
  26. #endif  /* _NO_DEBUGGING_AT_ALL_NOT_EVEN_A_LITTLE_BIT */
  27.  
  28. #ifdef __cplusplus
  29. #ifdef _USE_MWERKS_DEBUGGING
  30.  
  31. #define Debug_Signal
  32. #define Debug_Throw
  33. /* PowerPlant */
  34. #include <UDebugging.h>
  35. #include <UException.h>
  36.  
  37. #else /* _USE_MWERKS_DEBUGGING */
  38.  
  39. typedef long ExceptionCode;
  40. #define Throw_(err)  throw (ExceptionCode)(err)
  41. #define ThrowOSErr_(err)  Throw_(err)
  42. #define ThrowIfOSErr_(err)                    \
  43.     do {                                    \
  44.         OSErr err_ = (err);                    \
  45.         if (err_ != noErr) Throw_(err_);    \
  46.     } while (0)
  47. #define ThrowIfNULL_(ptr)  do {if ((ptr) == NULL) Throw_('null');} while (0)
  48. #define ThrowIfMemFail_(ptr)  do {if ((ptr) == NULL) Throw_(memFullErr);} while (0)
  49.  
  50. #endif  /* _USE_MWERKS_DEBUGGING */
  51. #endif  /* __cplusplus */
  52.  
  53. #ifdef __cplusplus
  54. }
  55. #endif
  56.  
  57. #endif  /* DGDEBUGGING_H */
  58.